﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Data;

namespace Microsoft.Samples.Office.UnifiedCommunications.Gadget
{
    /// <summary>
    /// In the Fav5Config screen, PhoneNumber contacts should only have "Phone Call" available as
    ///     a default click action. Use this value converter to disable the others. 
    /// </summary>
    public class IsPhoneNumberConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            bool isPhoneNumber = bool.Parse(value.ToString());

            if (isPhoneNumber)
                return false;
            else
                return true;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
